<template>
  <div class="mytools">
    <el-card>
      <div>
        <!-- 左边 -->
        <div class="left" v-if="showLeft">
          <i class="el-icon-info"></i>
          <slot name="left">
            <span>本月：社保在缴 公积金在缴 增员 减员 入职 离职</span>
          </slot>
        </div>
      </div>
      <!-- 右边 -->
      <div class="right">
        <slot name="right">
          <el-button size="mini" type="primary" @click="doClick">导入</el-button>
          <el-button size="mini" type="primary" @click="$emit('openDialog')"
            ><i class="el-icon-plus"></i> 新增员工</el-button
          >
        </slot>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'mytools',
  props: ['showLeft'],
  methods: {
    doClick(){
      this.$router.push('/employees/import')
    }
  },
}
</script>

<style lang="scss">
.mytools {
  .el-card__body {
    display: flex;
    justify-content: space-between;
    align-items: center;

    .left {
      font-size: 14px;
      background-color: #e6f7ff;
      border: 1px solid #d1eeff;
      padding: 10px;

      i {
        color: #419eff;
        margin-right: 10px;
      }
    }
  }
}
</style>
